The present invention relates to applets in a virtual machine and more particularly to the display of multiple applets on a single browser window while optimizing the number of server connections.
The Internet is a global network that allows users to communicate information. To access this information, a user executes a client program, usually a Web browser such as HotJava, Netscape, or Microsoft Explorer, which connects the user to the Internet. The Web browser issues specific commands to the Internet which accesses a particular Web server. A Web server is a computer system that provides information to the client through the Internet link.
Once a connection to the Internet has been established, the user can then retrieve a multitude of Web sites. A Web site is a series of screen displays (Web pages) consisting of text, pictorial, and other information about a particular subject, organization, or company. Web pages can be created using HyperText Markup Language ("HTML"). A particular Web site can be retrieved from the Internet by specifying its Web site address to the Web browser.
Java is an increasingly well-known and popular object-oriented programming language which was developed by Sun Microsystems in 1995. Java's architecture allows machine-independent executable instructions to be distributed over a network onto a Java enabled Web browser. Unlike many other programming languages, Java is interpreted and is designed to be highly machine independent and can run under many browser clients. This includes Sun workstations, Pcs, Macs, PDAs, and even television sets. In one implementation, a Java interpreter runs within a client's processor space and can execute the Java interpreted instructions on the client within the Web browser.
Java supports all of the productivity enhancing features of object-oriented programming. For example, Java enables programmers to use existing classes to create new classes. This is called inheritance. A class is a category of objects. By defining a new class, a programmer specifies the shape and behavior of all objects later defined to be instances of that class, including the data they will contain and the operations they will perform.
During the development of Java, the developers realized that code downloaded from a network may be less secure than code that resides on a local hard drive. Therefore, one of the desirable features of Java is the fact that Java executable instructions have only limited access to computer system resources, such as the file system. Among other things, this provides some protection from viruses or from maliciously designed code or erroneous code from corrupting system resources.
Java utilizes applets as a security mechanism to prevent any linked viruses from attaching to the client's hard drive. An applet is a small program with a single purpose designed to be distributed across a network, usually the Internet, often to add extra functionality to some other program, such as a Web browser. In Java, a user can specify exactly which directories applets can read from and write to.
An applet is not executed directly by the processor, but rather by an implementation of a Java virtual machine (VM). The Java VM is another name for the Java interpreter. The Java interpreter is built into many popular Web browsers such as Netscape and HotJava. The Java VM produces no machine instructions specific to a particular processor but rather single compiled versions of the program, called bytecodes. These bytecodes are downloaded onto the Web browser in the form of an applet, and the VM interprets and runs the program code.
An application differs from an applet in that an application is a stand alone program, usually executable code, that resides on a processor. If an application contains a virus and the application is downloaded from the Internet onto the processor, the processor may become infected. Hence, an applet provides a more secure medium for data transmission as compared to an application.
In an operating system environment, multiple programs having multiple applets can be run simultaneously. Each of these programs has at least one thread within it. A thread is a parallel path of execution which runs independently. Problems arise when multiple threads attempt to connect to a server simultaneously. For example, suppose a user wishes to display or update multiple applets on a single Web page. This requires that each applet establish its own connection to the server. If more than one applet requests data from the server at the same time, one applet may be competing with another applet for a server connection. Hence, each applet may be waiting to initiate a server connection resulting in inefficiencies. Furthermore, a first applet may be accessing data file A and waiting for data file B and a second applet may be accessing data file B and waiting for data file A resulting in deadlock.
Ideally, what is needed is a mechanism for allowing a group of applets to communicate with a server efficiently.